<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<style>
#space {
  height: 1000px;
}
#input {
  width: 100px;
}
</style>

<div id="space"></div>
<input type="text" id="input" value="abcdefghijklmnopqrstuvwxyz"/>

<script>
test(function(t) {
  var input = document.getElementById("input");
  input.setSelectionRange(20, 22);
  input.focus();
  assert_not_equals(window.scrollY, 0);
}, "Tests that when focusing on an input element with invisible selections, " +
   "the page doesn't reset to top.");
</script>
